home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar / 1998 / Feb / di9802dm / calendarx / CalendarX_TLB.pas < prev    next >
Pascal/Delphi Source File  |  1997-08-11  |  10KB  |  290 lines

  1. unit CalendarX_TLB;
  2.  
  3. { This file contains pascal declarations imported from a type library.
  4.   This file will be written during each import or refresh of the type
  5.   library editor.  Changes to this file will be discarded during the
  6.   refresh process. }
  7.  
  8. { CalendarX Library }
  9. { Version 1.0 }
  10.  
  11. interface
  12.  
  13. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  14.  
  15. const
  16.   LIBID_CalendarX: TGUID = '{7FD22F02-C0E1-11D0-9BB9-00A024604D21}';
  17.  
  18. const
  19.  
  20. { TxBorderStyle }
  21.  
  22.   bsNone = 0;
  23.   bsSingle = 1;
  24.  
  25. const
  26.  
  27. { Component class GUIDs }
  28.   Class_CalendarX: TGUID = '{7FD22F05-C0E1-11D0-9BB9-00A024604D21}';
  29.  
  30. type
  31.  
  32. { Forward declarations: Interfaces }
  33.   ICalendarX = interface;
  34.   ICalendarXDisp = dispinterface;
  35.   ICalendarXEvents = dispinterface;
  36.  
  37. { Forward declarations: CoClasses }
  38.   CalendarX = ICalendarX;
  39.  
  40. { Forward declarations: Enums }
  41.   TxBorderStyle = TOleEnum;
  42.  
  43. { Dispatch interface for CalendarX Control }
  44.  
  45.   ICalendarX = interface(IDispatch)
  46.     ['{7FD22F03-C0E1-11D0-9BB9-00A024604D21}']
  47.     function Get_CalendarDate: TDateTime; safecall;
  48.     procedure Set_CalendarDate(Value: TDateTime); safecall;
  49.     procedure NextMonth; safecall;
  50.     procedure NextYear; safecall;
  51.     procedure PrevMonth; safecall;
  52.     procedure PrevYear; safecall;
  53.     procedure UpdateCalendar; safecall;
  54.     function Get_BorderStyle: TxBorderStyle; safecall;
  55.     procedure Set_BorderStyle(Value: TxBorderStyle); safecall;
  56.     function Get_Color: TColor; safecall;
  57.     procedure Set_Color(Value: TColor); safecall;
  58.     function Get_Ctl3D: WordBool; safecall;
  59.     procedure Set_Ctl3D(Value: WordBool); safecall;
  60.     function Get_Day: Integer; safecall;
  61.     procedure Set_Day(Value: Integer); safecall;
  62.     function Get_Enabled: WordBool; safecall;
  63.     procedure Set_Enabled(Value: WordBool); safecall;
  64.     function Get_Font: Font; safecall;
  65.     procedure Set_Font(const Value: Font); safecall;
  66.     function Get_GridLineWidth: Integer; safecall;
  67.     procedure Set_GridLineWidth(Value: Integer); safecall;
  68.     function Get_Month: Integer; safecall;
  69.     procedure Set_Month(Value: Integer); safecall;
  70.     function Get_ParentColor: WordBool; safecall;
  71.     procedure Set_ParentColor(Value: WordBool); safecall;
  72.     function Get_ReadOnly: WordBool; safecall;
  73.     procedure Set_ReadOnly(Value: WordBool); safecall;
  74.     function Get_StartOfWeek: Smallint; safecall;
  75.     procedure Set_StartOfWeek(Value: Smallint); safecall;
  76.     function Get_UseCurrentDate: WordBool; safecall;
  77.     procedure Set_UseCurrentDate(Value: WordBool); safecall;
  78.     function Get_Visible: WordBool; safecall;
  79.     procedure Set_Visible(Value: WordBool); safecall;
  80.     function Get_Year: Integer; safecall;
  81.     procedure Set_Year(Value: Integer); safecall;
  82.     function Get_Cursor: Smallint; safecall;
  83.     procedure Set_Cursor(Value: Smallint); safecall;
  84.     property CalendarDate: TDateTime read Get_CalendarDate write Set_CalendarDate;
  85.     property BorderStyle: TxBorderStyle read Get_BorderStyle write Set_BorderStyle;
  86.     property Color: TColor read Get_Color write Set_Color;
  87.     property Ctl3D: WordBool read Get_Ctl3D write Set_Ctl3D;
  88.     property Day: Integer read Get_Day write Set_Day;
  89.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  90.     property Font: Font read Get_Font write Set_Font;
  91.     property GridLineWidth: Integer read Get_GridLineWidth write Set_GridLineWidth;
  92.     property Month: Integer read Get_Month write Set_Month;
  93.     property ParentColor: WordBool read Get_ParentColor write Set_ParentColor;
  94.     property ReadOnly: WordBool read Get_ReadOnly write Set_ReadOnly;
  95.     property StartOfWeek: Smallint read Get_StartOfWeek write Set_StartOfWeek;
  96.     property UseCurrentDate: WordBool read Get_UseCurrentDate write Set_UseCurrentDate;
  97.     property Visible: WordBool read Get_Visible write Set_Visible;
  98.     property Year: Integer read Get_Year write Set_Year;
  99.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  100.   end;
  101.  
  102. { DispInterface declaration for Dual Interface ICalendarX }
  103.  
  104.   ICalendarXDisp = dispinterface
  105.     ['{7FD22F03-C0E1-11D0-9BB9-00A024604D21}']
  106.     property CalendarDate: TDateTime dispid 1;
  107.     procedure NextMonth; dispid 2;
  108.     procedure NextYear; dispid 3;
  109.     procedure PrevMonth; dispid 4;
  110.     procedure PrevYear; dispid 5;
  111.     procedure UpdateCalendar; dispid 6;
  112.     property BorderStyle: TxBorderStyle dispid 7;
  113.     property Color: TColor dispid 8;
  114.     property Ctl3D: WordBool dispid 9;
  115.     property Day: Integer dispid 10;
  116.     property Enabled: WordBool dispid 11;
  117.     property Font: Font dispid 12;
  118.     property GridLineWidth: Integer dispid 13;
  119.     property Month: Integer dispid 14;
  120.     property ParentColor: WordBool dispid 15;
  121.     property ReadOnly: WordBool dispid 16;
  122.     property StartOfWeek: Smallint dispid 17;
  123.     property UseCurrentDate: WordBool dispid 18;
  124.     property Visible: WordBool dispid 19;
  125.     property Year: Integer dispid 20;
  126.     property Cursor: Smallint dispid 21;
  127.   end;
  128.  
  129. { Events interface for CalendarX Control }
  130.  
  131.   ICalendarXEvents = dispinterface
  132.     ['{7FD22F04-C0E1-11D0-9BB9-00A024604D21}']
  133.     procedure OnClick; dispid 1;
  134.     procedure OnChange; dispid 2;
  135.     procedure OnDblClick; dispid 3;
  136.     procedure OnKeyPress(var Key: Smallint); dispid 4;
  137.   end;
  138.  
  139. { CalendarXControl }
  140.  
  141.   TCalendarXOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  142.  
  143.   TCalendarX = class(TOleControl)
  144.   private
  145.     FOnClick: TNotifyEvent;
  146.     FOnChange: TNotifyEvent;
  147.     FOnDblClick: TNotifyEvent;
  148.     FOnKeyPress: TCalendarXOnKeyPress;
  149.     FIntf: ICalendarX;
  150.     function GetControlInterface: ICalendarX;
  151.   protected
  152.     procedure CreateControl;
  153.     procedure InitControlData; override;
  154.     function GetTOleEnumProp(Index: Integer): TOleEnum;
  155.     procedure SetTOleEnumProp(Index: Integer; Value: TOleEnum);
  156.   public
  157.     procedure NextMonth;
  158.     procedure NextYear;
  159.     procedure PrevMonth;
  160.     procedure PrevYear;
  161.     procedure UpdateCalendar;
  162.     property ControlInterface: ICalendarX read GetControlInterface;
  163.   published
  164.     property TabStop;
  165.     property Align;
  166.     property DragCursor;
  167.     property DragMode;
  168.     property ParentShowHint;
  169.     property PopupMenu;
  170.     property ShowHint;
  171.     property TabOrder;
  172.     property OnDragDrop;
  173.     property OnDragOver;
  174.     property OnEndDrag;
  175.     property OnEnter;
  176.     property OnExit;
  177.     property OnStartDrag;
  178.     property CalendarDate: TDateTime index 1 read GetTDateTimeProp write SetTDateTimeProp stored False;
  179.     property BorderStyle: TxBorderStyle index 7 read GetTOleEnumProp write SetTOleEnumProp stored False;
  180.     property Color: TColor index 8 read GetTColorProp write SetTColorProp stored False;
  181.     property Ctl3D: WordBool index 9 read GetWordBoolProp write SetWordBoolProp stored False;
  182.     property Day: Integer index 10 read GetIntegerProp write SetIntegerProp stored False;
  183.     property Enabled: WordBool index 11 read GetWordBoolProp write SetWordBoolProp stored False;
  184.     property Font: TFont index 12 read GetTFontProp write SetTFontProp stored False;
  185.     property GridLineWidth: Integer index 13 read GetIntegerProp write SetIntegerProp stored False;
  186.     property Month: Integer index 14 read GetIntegerProp write SetIntegerProp stored False;
  187.     property ParentColor: WordBool index 15 read GetWordBoolProp write SetWordBoolProp stored False;
  188.     property ReadOnly: WordBool index 16 read GetWordBoolProp write SetWordBoolProp stored False;
  189.     property StartOfWeek: Smallint index 17 read GetSmallintProp write SetSmallintProp stored False;
  190.     property UseCurrentDate: WordBool index 18 read GetWordBoolProp write SetWordBoolProp stored False;
  191.     property Visible: WordBool index 19 read GetWordBoolProp write SetWordBoolProp stored False;
  192.     property Year: Integer index 20 read GetIntegerProp write SetIntegerProp stored False;
  193.     property Cursor: Smallint index 21 read GetSmallintProp write SetSmallintProp stored False;
  194.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  195.     property OnChange: TNotifyEvent read FOnChange write FOnChange;
  196.     property